 
<template>
	<div :style="style">
		{{text}}
	</div>
</template>
   
<script>
export default {
	name: "Ellipsis",
	props: {
		// 文字内容
		text: {
			default: "",
		},
		// 超出多少行省略
		lineClamp: {
			type: Number,
			default: 2,
		},
	},
	data() {
		return {

		};
	},
	computed: {
		style() {
			return {
				display: "-webkit-box",
				"text-overflow": "ellipsis",
				overflow: "hidden",
				"-webkit-line-clamp": this.lineClamp,
				"-webkit-box-orient": "vertical",
			};
		},
	},
	methods: {

	},
};
</script>